export default {
  methods: {
    zoomIn() {
      this.flowGraph.graph.zoom(0.2)
    },
    zoomOut() {
      // 缩小
      this.flowGraph.graph.zoom(-0.2)
    },
    originalScale() {
      this.flowGraph.graph.zoomTo(1)
    },
    undo() {
      this.flowGraph.graph.history.undo()
    },
    redo() {
      this.flowGraph.graph.history.redo()
    },
    del() {
      const currentCells = this.flowGraph.graph.getSelectedCells()
      this.flowGraph.graph.model.removeCells(currentCells)
    },
    copy() {
      const selectedCell = this.flowGraph.graph?.getSelectedCells()
      // console.log(this.flowGraph.graph?.getSelectedCells(), '----')
      this.flowGraph.graph.copy(selectedCell)
      this.$message.success('复制成功')
      this.isDisabledBtn.canPaste = true
    },
    paste() {
      const selectedCell = this.flowGraph.graph?.getSelectedCells()
      this.flowGraph.graph.paste(selectedCell)
    },
  }
}